package com.lzy.product.apis.impl;

import com.github.pagehelper.PageInfo;
import com.lzy.framework.component.PageBean;
import com.lzy.framework.core.orm.db.Pager;
import com.lzy.product.apis.AgentOrderInfoServiceApi;
import com.lzy.product.apis.ProductUserServiceApi;
import com.lzy.product.dtos.agent.AgentOrderInfoDto;
import com.lzy.product.dtos.agent.AgentOrderSalesRecordDto;
import com.lzy.product.service.AgentOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class AgentOrderInfoServiceApiImpl implements AgentOrderInfoServiceApi {

    @Autowired
    private AgentOrderInfoService agentOrderInfoService;

    @Override
    public PageBean query(Pager pager, AgentOrderInfoDto agentOrderInfoDto) {
        return agentOrderInfoService.selectList(pager, agentOrderInfoDto);
    }

    @Override
    public AgentOrderInfoDto queryOrderById(Long orderId) {
        return agentOrderInfoService.findById(orderId);
    }

    @Override
    public Long insert(AgentOrderInfoDto agentOrderInfoDto) {
        return agentOrderInfoService.insert(agentOrderInfoDto);
    }

    @Override
    public AgentOrderInfoDto findByOrderId(Long orderId) {
        return agentOrderInfoService.findByOrderId(orderId);
    }

    @Override
    public Boolean updateAgentOrder(AgentOrderInfoDto dto) {
        return agentOrderInfoService.updateAgentOrder(dto);
    }

    @Override
    public BigDecimal queryTotalPriceByUserId(Long userId) {
        return agentOrderInfoService.queryTotalPriceByUserId(userId);
    }

    @Override
    public PageInfo<AgentOrderSalesRecordDto> statisticalSalesRecord(Pager pager, AgentOrderInfoDto agentOrderInfoDto) {
        return agentOrderInfoService.statisticalSalesRecord(pager, agentOrderInfoDto);
    }

    @Override
    public List<AgentOrderSalesRecordDto> statisticalSalesRecordByCondition(String idList, Integer type, String time) {
        return agentOrderInfoService.statisticalSalesRecordByCondition(idList, type, time);
    }
    @Override
    public AgentOrderInfoDto queryContractByOrderId(Long orderId){
        return agentOrderInfoService.queryContractByOrderId(orderId);
    }
}
